<%@ page language="java"  import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>手工数据补录平台</title>
<script src="jquery/jquery-3.5.1.min.js" type="text/javascript"></script>
<link href="css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript">
	if(top.location!=self.location){
	    top.location = "loginUi";
	}
</script>
<style type="text/css">
 body {
            width: 100%;
            height: 100%;
            /*color: #fff;*/
            font-family: "微软雅黑";
            font-size: 18px;
            background-image: url('images/index6.png');
            background-size: 100%,100%;
            position: absolute;
            background-repeat: no-repeat;
            -moz-background-size: 100% 100%;
            overflow-x: hidden;
            overflow-y: hidden;
        }

        .form-group {
            position: relative;
        }

        .login_btn {
            display: block;
            background: #d4010e;
            color: #fff;
            font-size: 15px;
            width: 80%;
            line-height: 50px;
            border-radius: 3px;
            border: none;
            /*margin-top: 40px;*/
        }

        .login_input {
            width: 80%;
            border: 2px solid #d4010e;
            border-radius: 3px;
            line-height: 40px;
            padding: 2px 5px 2px 30px;
            background: none;
            color: #000000;
        }

        input:-ms-input-placeholder {
            color: #000;
        }

        input:-ms-webkit-autofill {
            background-color: none;
        }
</style>
    <%--SM3加密 START--%>
    <script type="text/javascript" src="js/sm3/core.js"></script>
    <script type="text/javascript" src="js/sm3/cipher-core.js"></script>
    <script type="text/javascript" src="js/sm3/jsbn.js"></script>
    <script type="text/javascript" src="js/sm3/jsbn2.js"></script>
    <script type="text/javascript" src="js/sm3/sm3.js"></script>
    <script type="text/javascript" src="js/sm3/SM3Utils.js"></script>
    <%--SM3加密 END--%>
</head>
<%
    //增加随机数，解决 CSRF 漏洞
    String uuid = UUID.randomUUID().toString().replaceAll("-", "");
    request.getSession().setAttribute("authId", uuid);
    request.setAttribute("authId", uuid);
%>

<body>
<%--<div style="width: 480px; height: 20px; position: absolute; margin-top: 11%; text-align: center; font-size: 30px; color: #000000;">
    <p>瑞福德手工数据补录平台</p>
</div>--%>
 <div style="width: 40%; height: 40%; margin-top: 23%; margin-left: 15%;">
        <div style="margin: 0px auto; padding-top: 25px; padding-left: 20px;">
            <form  id="form1" method="post" action="login">
                <input type="hidden" name="randSession"  value = "<%=request.getSession().getAttribute("authId")%>" />
                <div class="form-group mg-t20">
                    <input type="text" style="height: 50px;" class="login_input" id="loginId" name="loginId" placeholder="Please enter a user name" />
                </div>
                <div class="form-group mg-t20">
                    <input type="password" style="height: 50px;" class="login_input" id="password" name="password" placeholder="Please enter password" />
                </div>
                
                <p style="position: relative; ">
				    <span style="color: red;font-size: large;">${message}</span>
	            </p>
                
                <div class="checkbox mg-t20">
                    <input class="login_btn" type="button" onclick="login()" id="loginc" value="Login"/>
                </div>
            </form>
        </div>
    </div>
    <div style="width: 480px; height: 20px; position: absolute; margin-top: 11%; text-align: center; font-size: 10px; color: #808080;">
        <p>上海剑阁信息技术有限公司 © 版权所有 www.swordgate.com.cn</p>
    </div>


<script type="text/javascript">
 //点击登录按钮
   function login(){

       $('#password').val(SM3Encrypt($('#password').val()));
	   $("#form1").submit();
   }
   
   $(function(){
		//登录页绑定enter键登录
	   	$(document).keydown(function(event) { 
	   		if (($("#loginId").val() != "" && $("#password").val() != "")
	   			&& event.keyCode === 13) {
	   			$("#loginc").trigger("click");
	   			return false;
	   		}
	   	});
	});
</script>

</body>
</html>